<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Nodes access</title>
<script type="text/javascript">

	function showParagraphs() {
		
		var paragraphs = document.getElementsByTagName("p");
		for (var i = 0; i < paragraphs.length; i++) {
			alert(paragraphs[i].innerHTML);
		}
	}
	
	function removeElement(id) {
		
		var element = document.getElementById(id);
		element.parentNode.removeChild(element);
	}
</script>
</head>
<body>
<p>Zero</p>
<p>One</p>
<p>Two</p>
<button onClick="showParagraphs()">Show paragraphs</button>
<table>
	<tr id="John">
		<td>John</td><td><button onClick="removeElement('John')">Delete</button></td>
	</tr>
	<tr id="Doe">
		<td>Doe</td><td><button onClick="removeElement('Doe')">Delete</button></td>
	</tr>
	<tr id="Alaska">
		<td>Alaska</td><td><button onClick="removeElement('Alaska')">Delete</button></td>
	</tr>
</table>
</body>
</html>